I have the following code:
for oRow in oTable1 do {
for oCell in oRow do {
absNum = oCell."Absolute Number"
bFound = find(skOldTblObjs, absNum, oOldCell); //Will return true for this example
if (bFound) {
bSource = oOldCell."Object Text"; //empty string ''
bTarget = oCell."Object Text"; //empty string ''
setempty(tempBuf);
setempty(bResult);
infoBox("bResult: " bResult "") //Returns 'bResult: '
diff(bResult, bSource, bTarget);
infoBox("bResult: " bResult "") //Returns bResult: (long string which includes: {\f1015\fswiss\fcharset 136 Tahoma;})
}
}
}
I've made sure that both bSource and bTarget are empty strings. Instead of giving me an empty string in bResult, I am getting the value of bResult from the previous diff. Why would it do that?
Chris Christopher Cote - Wed Nov 02 12:22:20 EDT 2016 |
Re: Trouble with diff if both buffers empty strings
The diff result is a rich text string. As such, the result will contain a bunch of rtf formatting information. Buffer a = create Buffer b = create Buffer diffs = create a = "" b = "" string retval = diff(diffs, a, b) if (retval != "") display "Error: " retval else displayRich stringOf(diffs)
The displayed rich text string is empty. else display stringOf(diffs) and you'll see the rtf formatting information. |
Re: Trouble with diff if both buffers empty strings You need to set bResult to empty before performing the if (bFound)
If bfound = false then bResult will retain the old value. |